#include "Application.h"
#include "MainFrame.h"

using namespace Capybara;

// Unchecked 'treat wchar_t as built-in type'
// Changed subsystem to windows.

static const wxString langNames[] =
{
	_T("Default"),
	_T("English"),
	_T("Chinese")
};

static const wxLanguage langIds[] = 
{
	wxLANGUAGE_DEFAULT,
	wxLANGUAGE_ENGLISH,
	wxLANGUAGE_CHINESE
};

wxCOMPILE_TIME_ASSERT( WXSIZEOF(langNames) == WXSIZEOF(langIds),
                       LangArraysMismatch );

bool Application::OnInit()
{
	long lang = wxGetSingleChoiceIndex(
		_T("Set application's language to:"),
		_T("Language"),
		WXSIZEOF(langNames),
		langNames);

	locale.Init(langIds[lang], wxLOCALE_CONV_ENCODING);
	wxLocale::AddCatalogLookupPathPrefix(_T("./"));

	locale.AddCatalog(_T("internat"));

	MainFrame *frame = 
		new MainFrame(_("Hello World"), wxPoint(50,50), wxSize(450,340));
	frame->Show(true);
	SetTopWindow(frame);
	return true;
}

